# !/usr/bin/env python
# encoding=utf-8

import logging.config

logging.config.fileConfig("./000_log/logging.conf")

# create logger
logger = logging.getLogger("teststring")


def testStr():
    a = 1
    b = 'hello'
    logger.info(b)
    logger.info(str(a) + b)


def ifstr():
    b = ''
    c = 'world'
    if len(b) == 0:
        logger.info("此字符串判定为空")


def ifempty():
    string = 'hell'
    if string.strip() is not '':  # 变量为字符串类型(优雅的方式)
        print('not empty')
    else:
        print('empty')
    if string != '':  # 变量类型不确定
        print('not empty')
    else:
        print('empty')


if __name__ == '__main__':
    testStr()
    logger.info('*' * 40 + '字符串操作' + '*' * 40)
    ifstr()
    logger.info('*' * 40 + '字符串判空操作' + '*' * 40)
    ifempty()
